package com.health.mapp.exception;

import com.health.mapp.utils.DefaultResponse;
import com.health.mapp.utils.Response;

public class MappException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1253855467570932396L;
	private int code;
	private String errMsg;
	
	private Response resp  = new DefaultResponse();
	
	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getErrMsg() {
		return errMsg;
	}

	public void setErrMsg(String errMsg) {
		this.errMsg = errMsg;
	}

	public MappException() {
		// TODO Auto-generated constructor stub
	}

	public MappException(String message) {
		super(message);
		// TODO Auto-generated constructor stub
	}

	public MappException(Throwable cause) {
		super(cause);
		// TODO Auto-generated constructor stub
	}

	public MappException(String message, Throwable cause) {
		super(message, cause);
		// TODO Auto-generated constructor stub
	}

	public MappException(long code, String message) {
		super(message);
		resp.setErrorCode( code );
		resp.setErrorMsg(message);
	}
	
	public Response result(){
		return resp;
	}
}
